package dman;

import java.io.IOException;
import org.jdesktop.application.FrameView;
import javax.swing.*;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import com.sun.pdfview.PDFFile;
import com.sun.pdfview.PDFPage;
import dman.VIN_Desc.VIN_details;
import dman.VIN_DB.VINrecord;
import java.awt.Color;
import java.awt.Desktop;
import java.awt.Rectangle;
import java.io.File;
import java.io.RandomAccessFile;
import java.util.Iterator;
import javax.swing.table.DefaultTableModel;

public class DManView extends FrameView {

    public static final String DB_FILE="c:/Docs/docs.csv";
    public static final String VIN_FILE="c:/Docs/VINs.csv";
    public static final String DOCS_FOLDER="c:/Docs/docs/";
//    public static final String DB_FILE="docs.csv";  //Uncomment for network version
//    public static final String VIN_FILE="VINs.csv";
//    public static final String DOCS_FOLDER="docs/";
    private static final String SELECT_MAKE="select Make...";
    private static final String SELECT_MODEL="select Model...";
    private static final String SELECT_YEAR="select Year...";

    private String EditOpenedPDF;
    private File OpenedFile, EditOpenedFile;

    private PDFFile pdffile, EditPDFFile;
    private PDFPage page, EditPDFPage;
    private int curPage;
    private boolean PageLoaded = false;  // is anything loaded to PDFPage?
    private boolean EditPageLoaded = false;  // is anything loaded to Edit PDFPage?

    public VIN_Desc Desc;
    public VIN_DB DB;

    public DManView(DManApp app) {
        super(app);
        initComponents();
// Populate lists with that data
    }

    public void init () {
        PopulateVINlist();
        PopulateEditList (null);
        PopulateMakeModelList ();
        DManAboutBox.MainW=this;
    }

    private void PopulateMakeModelList () {
    //Populate choice1
        DefaultTableModel tbm = (DefaultTableModel) jTable1.getModel();
        tbm.setRowCount(0);
        boolean isPresent;
        choice1.removeAll();
        choice2.setEnabled(false);
        choice3.setEnabled(false);
        choice1.add(SELECT_MAKE);
        Iterator itr = Desc.VIN_Desc.iterator();
        while (itr.hasNext()) {
            isPresent=false;
            VIN_details record=(VIN_details) itr.next();
            for (int j=0;j<choice1.getItemCount();j++)
                if (choice1.getItem(j).equalsIgnoreCase(record.Make)) {
                   isPresent=true;
                   break;
                   }
            if (!isPresent) choice1.add(record.Make);
            }
//Populate jTable1, MakeList and ModelList
        itr = Desc.VIN_Desc.iterator();

        while (itr.hasNext()) {
            VIN_details record=(VIN_details) itr.next();
            String[] ar = new String[4];
            ar[0]=record.Make;
            ar[1]=record.Model;
            ar[2]=record.Year;
            ar[3]=record.VIN;
            tbm.addRow(ar);
        }
    }
 /**
 * Open DialogBox to Edit VIN
 */
    private void VINAdd (String VIN, int Mode) {
        if (VINEditBox == null) {
            JFrame mainFrame = DManApp.getApplication().getMainFrame();
            VINEditBox = new DManAboutBox(mainFrame);
            VINEditBox.setLocationRelativeTo(mainFrame);
        }
        VINEditBox.SetMode (Mode);
        VINEditBox.NewVIN (VIN);
        if (Mode==DManAboutBox.MODE_EDIT) {
            VINEditBox.SetVars ((String) jTable1.getValueAt(jTable1.getSelectedRow(), 0),
                                (String) jTable1.getValueAt(jTable1.getSelectedRow(), 1),
                                (String) jTable1.getValueAt(jTable1.getSelectedRow(), 2));
        }
        DManApp.getApplication().show(VINEditBox);
        Desc.SaveDesc(VIN_FILE);
        PopulateMakeModelList();
        PopulateEditList (null);
        PopulateVINlist ();
    }

    public void EditRecord (VIN_details record){
        String cVIN=(String) jTable1.getValueAt(jTable1.getSelectedRow(), 3);
        VIN_details mRecord;
        mRecord=Desc.getDetailsRecordByVIN(cVIN);
        mRecord.Model=record.Model;
        mRecord.Make=record.Make;
        mRecord.Year=record.Year;
        if (!cVIN.equalsIgnoreCase(record.VIN)) {
            mRecord.VIN=record.VIN;
            DB.replaceVIN (cVIN,record.VIN);
            DB.SaveDB(DB_FILE);
            }
    }

    private void PopulateVINlist () {
        label5.setText("");
        list2.removeAll();
        PageLoaded=false;
        jLabel1.setIcon(getResourceMap().getIcon("jLabel1.icon"));
        jSpinner1.setEnabled(false);
        label4.setEnabled (false);
        
        list1.removeAll();
        VINrecord record;
        for (int j=0;j<DB.VINs.size();j++) {
            record = (VINrecord) (DB.VINs.get(j));
            if (record.ID>0) {
                boolean duplicate = false;
                int i = 0;
                while (i < list1.getItemCount()) {
                      if (list1.getItem(i).equalsIgnoreCase(record.VIN))
                             duplicate = true;
                      i++;
                      }
                if (!duplicate)   list1.add(record.VIN);
            System.out.println(record.Desc);
        }
    }
}

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        label1 = new java.awt.Label();
        list1 = new java.awt.List();
        label2 = new java.awt.Label();
        list2 = new java.awt.List();
        jLabel1 = new javax.swing.JLabel();
        button1 = new java.awt.Button();
        button2 = new java.awt.Button();
        label3 = new java.awt.Label();
        jSpinner1 = new javax.swing.JSpinner();
        label4 = new java.awt.Label();
        label5 = new java.awt.Label();
        jPanel3 = new javax.swing.JPanel();
        label6 = new java.awt.Label();
        choice1 = new java.awt.Choice();
        label7 = new java.awt.Label();
        choice2 = new java.awt.Choice();
        label8 = new java.awt.Label();
        choice3 = new java.awt.Choice();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        button4 = new java.awt.Button();
        button6 = new java.awt.Button();
        jPanel2 = new javax.swing.JPanel();
        list3 = new java.awt.List();
        textField1 = new java.awt.TextField();
        textField2 = new java.awt.TextField();
        button3 = new java.awt.Button();
        jLabel2 = new javax.swing.JLabel();
        checkbox1 = new java.awt.Checkbox();
        checkbox2 = new java.awt.Checkbox();
        button5 = new java.awt.Button();

        jTabbedPane1.setName("jTabbedPane1"); // NOI18N

        jPanel1.setName("jPanel1"); // NOI18N

        label1.setName("label1"); // NOI18N
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(dman.DManApp.class).getContext().getResourceMap(DManView.class);
        label1.setText(resourceMap.getString("label1.text")); // NOI18N

        list1.setName("list1"); // NOI18N
        list1.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                list1ItemStateChanged(evt);
            }
        });

        label2.setName("label2"); // NOI18N
        label2.setText(resourceMap.getString("label2.text")); // NOI18N

        list2.setName("list2"); // NOI18N
        list2.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                list2ItemStateChanged(evt);
            }
        });

        jLabel1.setBackground(resourceMap.getColor("jLabel1.background")); // NOI18N
        jLabel1.setIcon(resourceMap.getIcon("jLabel1.icon")); // NOI18N
        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setAlignmentX(0.5F);
        jLabel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jLabel1.setMaximumSize(new java.awt.Dimension(51000, 38003));
        jLabel1.setMinimumSize(new java.awt.Dimension(100, 100));
        jLabel1.setName("jLabel1"); // NOI18N
        jLabel1.addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentResized(java.awt.event.ComponentEvent evt) {
                jLabel1ComponentResized(evt);
            }
        });

        button1.setLabel(resourceMap.getString("button1.label")); // NOI18N
        button1.setName("button1"); // NOI18N
        button1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button1ActionPerformed(evt);
            }
        });

        button2.setLabel(resourceMap.getString("button2.label")); // NOI18N
        button2.setName("button2"); // NOI18N
        button2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button2ActionPerformed(evt);
            }
        });

        label3.setName("label3"); // NOI18N
        label3.setText(resourceMap.getString("label3.text")); // NOI18N

        jSpinner1.setModel(new javax.swing.SpinnerNumberModel(1, 1, 1, 1));
        jSpinner1.setName("jSpinner1"); // NOI18N
        jSpinner1.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSpinner1StateChanged(evt);
            }
        });

        label4.setName("label4"); // NOI18N
        label4.setText(resourceMap.getString("label4.text")); // NOI18N

        label5.setName("label5"); // NOI18N
        label5.setText(resourceMap.getString("label5.text")); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(label1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(list1, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(label2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(list2, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 497, Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(button1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(label3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(label4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 148, Short.MAX_VALUE)
                        .addComponent(label5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(label2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(label1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(button1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(button2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(label3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(label5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(label4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(list1, javax.swing.GroupLayout.DEFAULT_SIZE, 497, Short.MAX_VALUE)
                    .addComponent(list2, javax.swing.GroupLayout.DEFAULT_SIZE, 497, Short.MAX_VALUE)
                    .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 497, Short.MAX_VALUE))
                .addContainerGap())
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel1.TabConstraints.tabTitle"), jPanel1); // NOI18N

        jPanel3.setName("jPanel3"); // NOI18N

        label6.setName("MakeLabel"); // NOI18N
        label6.setText(resourceMap.getString("MakeLabel.text")); // NOI18N

        choice1.setName("choice1"); // NOI18N
        choice1.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                choice1ItemStateChanged(evt);
            }
        });

        label7.setName("label7"); // NOI18N
        label7.setText(resourceMap.getString("label7.text")); // NOI18N

        choice2.setName("choice2"); // NOI18N
        choice2.setEnabled(false);
        choice2.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                choice2ItemStateChanged(evt);
            }
        });

        label8.setName("label8"); // NOI18N
        label8.setText(resourceMap.getString("label8.text")); // NOI18N

        choice3.setName("choice3"); // NOI18N
        choice3.setEnabled(false);
        choice3.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                choice3ItemStateChanged(evt);
            }
        });

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jTable1.setAutoCreateRowSorter(true);
        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Make", "Model", "Year", "VIN"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTable1.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS);
        jTable1.setName("jTable1"); // NOI18N
        jTable1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTable1MouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(jTable1);

        button4.setLabel(resourceMap.getString("button4.label")); // NOI18N
        button4.setName("button4"); // NOI18N
        button4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button4ActionPerformed(evt);
            }
        });

        button6.setLabel(resourceMap.getString("button6.label")); // NOI18N
        button6.setName("button6"); // NOI18N
        button6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button6ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 847, Short.MAX_VALUE)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(label6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(27, 27, 27)
                        .addComponent(choice1, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(label7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(choice2, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(label8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(2, 2, 2)
                        .addComponent(choice3, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 89, Short.MAX_VALUE)
                        .addComponent(button6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(label6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(choice1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(label7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(choice2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(label8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(choice3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(button4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(button6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 497, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel3.TabConstraints.tabTitle"), jPanel3); // NOI18N

        jPanel2.setName("jPanel2"); // NOI18N

        list3.setName("list3"); // NOI18N
        list3.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                list3ItemStateChanged(evt);
            }
        });

        textField1.setEnabled(false);
        textField1.setName("textField1"); // NOI18N
        textField1.setText(resourceMap.getString("textField1.text")); // NOI18N
        textField1.addTextListener(new java.awt.event.TextListener() {
            public void textValueChanged(java.awt.event.TextEvent evt) {
                textField1TextValueChanged(evt);
            }
        });

        textField2.setEnabled(false);
        textField2.setName("textField2"); // NOI18N
        textField2.setText(resourceMap.getString("textField2.text")); // NOI18N
        textField2.addTextListener(new java.awt.event.TextListener() {
            public void textValueChanged(java.awt.event.TextEvent evt) {
                textField2TextValueChanged(evt);
            }
        });

        button3.setEnabled(false);
        button3.setLabel(resourceMap.getString("button3.label")); // NOI18N
        button3.setName("button3"); // NOI18N
        button3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button3ActionPerformed(evt);
            }
        });

        jLabel2.setIcon(resourceMap.getIcon("jLabel2.icon")); // NOI18N
        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setAlignmentX(0.5F);
        jLabel2.setMaximumSize(new java.awt.Dimension(5100, 3083));
        jLabel2.setMinimumSize(new java.awt.Dimension(100, 100));
        jLabel2.setName("jLabel2"); // NOI18N
        jLabel2.addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentResized(java.awt.event.ComponentEvent evt) {
                jLabel2ComponentResized(evt);
            }
        });

        checkbox1.setLabel(resourceMap.getString("checkbox1.label")); // NOI18N
        checkbox1.setName("checkbox1"); // NOI18N
        checkbox1.setState(true);
        checkbox1.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                PopulateEditList(evt);
            }
        });

        checkbox2.setLabel(resourceMap.getString("checkbox2.label")); // NOI18N
        checkbox2.setName("checkbox2"); // NOI18N
        checkbox2.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                PopulateEditList(evt);
            }
        });

        button5.setLabel(resourceMap.getString("button5.label")); // NOI18N
        button5.setName("button5"); // NOI18N
        button5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button5ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(checkbox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(checkbox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(list3, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(button5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(textField1, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(25, 25, 25)
                        .addComponent(textField2, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(20, 20, 20)
                        .addComponent(button3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(232, Short.MAX_VALUE))
                    .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 665, Short.MAX_VALUE)))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(checkbox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(1, 1, 1)
                        .addComponent(checkbox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(list3, javax.swing.GroupLayout.DEFAULT_SIZE, 446, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(textField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(button3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(textField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 497, Short.MAX_VALUE)))
                .addContainerGap())
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel2.TabConstraints.tabTitle"), jPanel2); // NOI18N

        jTabbedPane1.getAccessibleContext().setAccessibleName(resourceMap.getString("jTabbedPane1.AccessibleContext.accessibleName")); // NOI18N

        setComponent(jTabbedPane1);
    }// </editor-fold>//GEN-END:initComponents

    private void ListDocs (String VIN) {
        //Fn loads list2 from DB by provided VIN
        label5.setText("");
        list2.removeAll();
        PageLoaded=false;
        jLabel1.setIcon(getResourceMap().getIcon("jLabel1.icon"));
        jSpinner1.setEnabled(false);
        label4.setEnabled (false);

        //load docs to label2
        //LogText ("comparing: "+VIN+"\n");
        VINrecord record;
        for (int i=0; i<DB.VINs.size(); i++){
            record =(VINrecord) DB.VINs.get(i);
            if (VIN.equalsIgnoreCase(record.VIN))
                    list2.add(record.Desc);
        }
    }

    private void LoadDoc (String VIN, String Desc)  {
        //load and display PDF by VIN and Desc
        VINrecord record;
        for (int i=0; i<DB.VINs.size(); i++){
            record=(VINrecord) DB.VINs.get(i);
            if (VIN.equalsIgnoreCase(record.VIN) && Desc.equalsIgnoreCase(record.Desc)) {
                try {
                    OpenedFile = new File(DOCS_FOLDER + record.FileName);
                    label5.setText(DOCS_FOLDER + record.FileName);
                    RandomAccessFile raf = new RandomAccessFile(OpenedFile, "r");
                    FileChannel channel = raf.getChannel();
                    ByteBuffer buf = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size());
                    pdffile = new PDFFile(buf);
                    page = pdffile.getPage(0);
                    label4.setEnabled (true);
                    label4.setText("out of "+(pdffile.getNumPages()));
                    SpinnerNumberModel model = (SpinnerNumberModel) jSpinner1.getModel();
                    model.setMaximum(pdffile.getNumPages());
//                    model.setValue(new Integer(1));
                    jSpinner1.setValue(new Integer(1));
                    jSpinner1.setEnabled(true);
//                    curPage=0;
                    PageLoaded = true;
                    RenderPDF ();
                    raf.close();
                } catch (IOException ex) {
                    PageLoaded = false;
                    jLabel1.setIcon(null);
                    System.out.println ("Error: "+ex.getMessage());
                }
            }
        }
    }

    private void RenderPDF (){
      if (PageLoaded) {        
        java.awt.Dimension rect = page.getUnstretchedSize (jLabel1.getWidth(), jLabel1.getHeight(),null );
        jLabel1.setIcon(
                        new ImageIcon(
                                      page.getImage(
                                                    rect.width,
                                                    rect.height,
                                                    new Rectangle(0, 0, (int) page.getBBox().getWidth(), (int) page.getBBox().getHeight()),
                                                    null, true, true)
                                      )
                        );
        }
    }

    private void RenderEditPDF (){
      if (EditPageLoaded) {
        java.awt.Dimension rect = EditPDFPage.getUnstretchedSize (jLabel2.getWidth(), jLabel2.getHeight(),null );
        jLabel2.setIcon(
                        new ImageIcon(
                                      EditPDFPage.getImage(
                                                    rect.width,
                                                    rect.height,
                                                    new Rectangle(0, 0, (int) EditPDFPage.getBBox().getWidth(), (int) EditPDFPage.getBBox().getHeight()),
                                                    null, true, true)
                                      )
                        );
        }
    }

    private void list1ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_list1ItemStateChanged
        ListDocs (list1.getSelectedItem());
        if (list2.getItemCount()==1){
            list2.select(0);
            LoadDoc (list1.getSelectedItem(), list2.getSelectedItem());
            }
    }//GEN-LAST:event_list1ItemStateChanged

    private void list2ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_list2ItemStateChanged
        LoadDoc (list1.getSelectedItem(), list2.getSelectedItem());
    }//GEN-LAST:event_list2ItemStateChanged

    private void jLabel1ComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_jLabel1ComponentResized
        RenderPDF ();
    }//GEN-LAST:event_jLabel1ComponentResized

    private void button1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button1ActionPerformed
      if (PageLoaded) {
        try {
            Desktop.getDesktop().open(OpenedFile);
        } catch (IOException ex) {
            System.out.println ("IOError: "+ex.getMessage());
        }
      }
    }//GEN-LAST:event_button1ActionPerformed

    private void button2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button2ActionPerformed
      if (PageLoaded) {
        try {
            Desktop.getDesktop().print(OpenedFile);
        } catch (IOException ex) {
            System.out.println ("IOError: "+ex.getMessage());
        }
      }
    }//GEN-LAST:event_button2ActionPerformed

    private void list3ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_list3ItemStateChanged
        try {
                    EditOpenedFile = new File(DOCS_FOLDER + list3.getSelectedItem());
                    RandomAccessFile raf = new RandomAccessFile(EditOpenedFile, "r");
                    FileChannel channel = raf.getChannel();
                    ByteBuffer buf = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size());
                    EditPDFFile = new PDFFile(buf);
                    EditPDFPage = EditPDFFile.getPage(0);
                    EditPageLoaded = true;
                    RenderEditPDF ();
                    raf.close();
                    VINrecord record = DB.getRecordByFileName (list3.getSelectedItem());
                    if (record.ID==0)
                        button3.setLabel("Add");
                    else {
                        button3.setLabel("Save");
                        textField1.setText (record.VIN);
                        textField2.setText (record.Desc);
                        }
                    button3.setEnabled (true);
                    textField1.setBackground(Color.pink);
                    textField1.setEnabled(true);
                    textField2.setBackground(Color.pink);
                    textField2.setEnabled(true);
                } catch (IOException ex) {
                    EditPageLoaded = false;
                    jLabel1.setIcon(null);
                    button3.setEnabled(false);
                    System.out.println ("Error: "+ex.getMessage());
                }
    }//GEN-LAST:event_list3ItemStateChanged

    private void textField1TextValueChanged(java.awt.event.TextEvent evt) {//GEN-FIRST:event_textField1TextValueChanged
        if (textField1.getText().trim().length()!=17)
           textField1.setBackground(Color.pink);
        else
           textField1.setBackground(Color.WHITE);
}//GEN-LAST:event_textField1TextValueChanged

    private void button3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button3ActionPerformed
    //Add button
        VINrecord record = DB.getRecordByFileName (list3.getSelectedItem());
        System.out.println ("Adding: "+list3.getSelectedItem());
        if (textField1.getText().trim().length()==0) {
            JOptionPane.showMessageDialog(null, "VIN can't be empty!");
        }
        else if (textField2.getText().trim().length()==0) {
            JOptionPane.showMessageDialog(null, "Description can't be empty!");
        }
        else {
            record.VIN=textField1.getText().trim();
            //Verify description is not duplicate-----------------------------------------------
            if (Desc.getDetailsRecordByVIN (record.VIN)==null)
                VINAdd (record.VIN, DManAboutBox.MODE_ADD);
            if (Desc.getDetailsRecordByVIN(record.VIN) != null) {
                record.Desc=textField2.getText().trim();
                record.ID=DB.getNewID();
                DB.SaveDB(DB_FILE);
                JOptionPane.showMessageDialog(null, "Saved...");
                PopulateVINlist();
                PopulateEditList (null);
                }
            else
                JOptionPane.showMessageDialog(null, "Can't process without VIN description!");
        }
    }//GEN-LAST:event_button3ActionPerformed

    private void textField2TextValueChanged(java.awt.event.TextEvent evt) {//GEN-FIRST:event_textField2TextValueChanged
        if (textField2.getText().isEmpty())
           textField2.setBackground(Color.pink);
        else
           textField2.setBackground(Color.WHITE);
    }//GEN-LAST:event_textField2TextValueChanged

    private void jLabel2ComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_jLabel2ComponentResized
        RenderEditPDF ();
    }//GEN-LAST:event_jLabel2ComponentResized

    private void PopulateEditList(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_PopulateEditList
// Populating list3 with FileNames; List defined by chexboxes
        if (EditPageLoaded) {

            jLabel2.setIcon(getResourceMap().getIcon("jLabel2.icon"));
            EditPageLoaded=false;
            EditPDFPage=null;
            EditPDFFile=null;
            EditOpenedPDF=null;
            EditOpenedFile=null;
        }
        list3.removeAll();
        button3.setEnabled(false);

        for (int i = 0; i < DB.listOfFiles.length; i++) {
            if (DB.listOfFiles[i].isFile()) {
               VINrecord record=DB.getRecordByFileName(DB.listOfFiles[i].getName());
               if (record!=null) {
                   //Show new files?
                   if (checkbox1.getState() && record.ID==0)
                      list3.add(DB.listOfFiles[i].getName());
                   else if (checkbox2.getState() && record.ID>0)
                      list3.add(DB.listOfFiles[i].getName());
                   }
               }
            }
    }//GEN-LAST:event_PopulateEditList

    private void button4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button4ActionPerformed
    //Open Docs button
        if (jTable1.getSelectedRow()==-1)
           JOptionPane.showMessageDialog(null, "Select record from table...");
        else {
            String cVIN=(String) jTable1.getValueAt(jTable1.getSelectedRow(), 3);
            int i=0;
            for (int j=0;j<list1.getItemCount();j++) {
                if (list1.getItem(j).equalsIgnoreCase(cVIN)) {
                   i=j+1;
                   break;
                    }
            }
            if (i==0) 
                 JOptionPane.showMessageDialog(null, "No documents exists for that VIN...");
            else {
                list1.select(i-1);
                ListDocs (cVIN);
                jTabbedPane1.setSelectedIndex(0);
                //If only one doc - show it-------------------------------------------------
                }
        }
    }//GEN-LAST:event_button4ActionPerformed

    private void button5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button5ActionPerformed
   //Refresh button
        DB.LoadFileList(DOCS_FOLDER, DB_FILE);
        PopulateVINlist ();
        PopulateEditList (null);
    }//GEN-LAST:event_button5ActionPerformed

    private void choice1ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_choice1ItemStateChanged
 //Populate choice2
        if (choice1.getSelectedItem().equalsIgnoreCase(SELECT_MAKE))
            PopulateMakeModelList ();
        else {
            choice2.setEnabled(true);
            choice3.setEnabled(false);
            DefaultTableModel tbm = (DefaultTableModel) jTable1.getModel();
            tbm.setRowCount(0);
            boolean isPresent;
            choice2.removeAll();
            choice2.add(SELECT_MODEL);
            Iterator itr = Desc.VIN_Desc.iterator();
            while (itr.hasNext()) {
                isPresent=false;
                VIN_details record=(VIN_details) itr.next();
                if (record.Make.equalsIgnoreCase(choice1.getSelectedItem())) {
                    for (int j=0;j<choice2.getItemCount();j++)
                        if (choice2.getItem(j).equalsIgnoreCase(record.Model)) {
                           isPresent=true;
                           break;
                           }
                    if (!isPresent) choice2.add(record.Model);
                    }
                }
//Populate jTable1, MakeList and ModelList
            itr = Desc.VIN_Desc.iterator();
            VIN_details record;
            while (itr.hasNext()) {
                record=(VIN_details) itr.next();
                if (record.Make.equalsIgnoreCase(choice1.getSelectedItem())) {
                    String[] ar = new String[4];
                    ar[0]=record.Make;
                    ar[1]=record.Model;
                    ar[2]=record.Year;
                    ar[3]=record.VIN;
                    tbm.addRow(ar);
                    }
            }
        }
    }//GEN-LAST:event_choice1ItemStateChanged

    private void button6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button6ActionPerformed
        if (jTable1.getSelectedRow()==-1)
           JOptionPane.showMessageDialog(null, "Select record from table...");
        else {
            String cVIN=(String) jTable1.getValueAt(jTable1.getSelectedRow(), 3);
            VINAdd(cVIN, DManAboutBox.MODE_EDIT);
            }
    }//GEN-LAST:event_button6ActionPerformed

    private void choice2ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_choice2ItemStateChanged
 //Populate choice3
        if (choice2.getSelectedItem().equalsIgnoreCase(SELECT_MODEL))
            choice1ItemStateChanged (null);
        else {
            choice3.setEnabled(true);
            DefaultTableModel tbm = (DefaultTableModel) jTable1.getModel();
            tbm.setRowCount(0);
            boolean isPresent;
            choice3.removeAll();
            choice3.add(SELECT_YEAR);
            Iterator itr = Desc.VIN_Desc.iterator();
            while (itr.hasNext()) {
                isPresent=false;
                VIN_details record=(VIN_details) itr.next();
                if (record.Model.equalsIgnoreCase(choice2.getSelectedItem())) {
                    for (int j=0;j<choice3.getItemCount();j++)
                        if (choice3.getItem(j).equalsIgnoreCase(record.Year)) {
                           isPresent=true;
                           break;
                           }
                    if (!isPresent) choice3.add(record.Year);
                    }
                }
//Populate jTable1, MakeList and ModelList
            itr = Desc.VIN_Desc.iterator();
            VIN_details record;
            while (itr.hasNext()) {
                record=(VIN_details) itr.next();
                if (record.Make.equalsIgnoreCase(choice1.getSelectedItem()) &&
                    record.Model.equalsIgnoreCase(choice2.getSelectedItem())) {
                     String[] ar = new String[4];
                     ar[0]=record.Make;
                     ar[1]=record.Model;
                     ar[2]=record.Year;
                     ar[3]=record.VIN;
                     tbm.addRow(ar);
                     }
            }
        }
    }//GEN-LAST:event_choice2ItemStateChanged

    private void choice3ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_choice3ItemStateChanged
 //Populate choice3
        if (choice3.getSelectedItem().equalsIgnoreCase(SELECT_YEAR))
            choice2ItemStateChanged (null);
        else {
//Populate jTable1, MakeList and ModelList
            DefaultTableModel tbm = (DefaultTableModel) jTable1.getModel();
            tbm.setRowCount(0);
            Iterator itr = Desc.VIN_Desc.iterator();
            VIN_details record;
            while (itr.hasNext()) {
                record=(VIN_details) itr.next();
                if (record.Make.equalsIgnoreCase(choice1.getSelectedItem()) &&
                    record.Model.equalsIgnoreCase(choice2.getSelectedItem()) &&
                    record.Year.equalsIgnoreCase(choice3.getSelectedItem())) {
                     String[] ar = new String[4];
                     ar[0]=record.Make;
                     ar[1]=record.Model;
                     ar[2]=record.Year;
                     ar[3]=record.VIN;
                     tbm.addRow(ar);
                     }
            }
        }
    }//GEN-LAST:event_choice3ItemStateChanged

    private void jSpinner1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSpinner1StateChanged
        SpinnerNumberModel model = (SpinnerNumberModel) jSpinner1.getModel();
        page = pdffile.getPage(model.getNumber().intValue());
        RenderPDF ();
    }//GEN-LAST:event_jSpinner1StateChanged

    private long lastClick=0;
    private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable1MouseClicked
       if ((evt.getWhen ()-lastClick)<300)
          button4ActionPerformed (null);
       lastClick=evt.getWhen();
    }//GEN-LAST:event_jTable1MouseClicked

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private java.awt.Button button1;
    private java.awt.Button button2;
    private java.awt.Button button3;
    private java.awt.Button button4;
    private java.awt.Button button5;
    private java.awt.Button button6;
    private java.awt.Checkbox checkbox1;
    private java.awt.Checkbox checkbox2;
    private java.awt.Choice choice1;
    private java.awt.Choice choice2;
    private java.awt.Choice choice3;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSpinner jSpinner1;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTable jTable1;
    private java.awt.Label label1;
    private java.awt.Label label2;
    private java.awt.Label label3;
    private java.awt.Label label4;
    private java.awt.Label label5;
    private java.awt.Label label6;
    private java.awt.Label label7;
    private java.awt.Label label8;
    private java.awt.List list1;
    private java.awt.List list2;
    private java.awt.List list3;
    private java.awt.TextField textField1;
    private java.awt.TextField textField2;
    // End of variables declaration//GEN-END:variables

    private DManAboutBox VINEditBox;
}
